package cn.nexd.app.collector.model;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * Created by xun on 2016/8/11.
 */
public class CollectConfig implements Parcelable {
    private String collectWay; // wifi / 蓝牙 / 或者
    private long collectSpeed;
    private long collectTime;

    public CollectConfig(String collectWay, long collectSpeed, long collectTime) {
        this.collectWay = collectWay;
        this.collectSpeed = collectSpeed;
        this.collectTime = collectTime;
    }

    protected CollectConfig(Parcel in) {
        collectWay = in.readString();
        collectSpeed = in.readLong();
        collectTime = in.readLong();
    }

    public static final Creator<CollectConfig> CREATOR = new Creator<CollectConfig>() {
        @Override
        public CollectConfig createFromParcel(Parcel in) {
            return new CollectConfig(in);
        }

        @Override
        public CollectConfig[] newArray(int size) {
            return new CollectConfig[size];
        }
    };

    public void setCollectWay(String collectWay) {
        this.collectWay = collectWay;
    }

    public void setCollectSpeed(long collectSpeed) {
        this.collectSpeed = collectSpeed;
    }

    public void setCollectTime(long collectTime) {
        this.collectTime = collectTime;
    }

    public String getCollectWay() {
        return collectWay;
    }

    public long getCollectSpeed() {
        return collectSpeed;
    }

    public long getCollectTime() {
        return collectTime;
    }

    @Override
    public String toString() {
        return "CollectConfig{" +
                "collectWay='" + collectWay + '\'' +
                ", collectSpeed='" + collectSpeed + '\'' +
                ", collectTime='" + collectTime + '\'' +
                '}';
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel parcel, int i) {
        parcel.writeString(collectWay);
        parcel.writeLong(collectSpeed);
        parcel.writeLong(collectTime);
    }
}
